<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html>
<head>
	<meta charset="UTF-8">
	
		<title><?php echo C('WEB_TITLE');?></title>
	
	<link rel="stylesheet" type="text/css" href="../Public/css/base.css" media="all">
	<link rel="stylesheet" type="text/css" href="../Public/css/module.css">
	<link rel="stylesheet" type="text/css" href="../Public/css/style.css" media="all">
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/Js/artDialog/skins/default.css">
	<script type="text/javascript" src="__PUBLIC__/Js/jquery.js"></script>
	<script type="text/javascript" src="__PUBLIC__/Js/artDialog/jquery.artDialog.min.js"></script>
	<script type="text/javascript" src="__PUBLIC__/Js/artDialog/artDialog.plugins.min.js"></script>
	<script type="text/javascript" src="../Public/js/common.js"></script>
	<?php if(in_array((ACTION_NAME), explode(',',"add,edit"))): ?><script type="text/javascript" src="__PUBLIC__/Js/ValidForm.js"></script><?php endif; ?>
	
	<script type="text/javascript">
        var URL	   ='__URL__';
        var PUBLIC = "../Public/";
    </script>
</head>
<body style="padding:0;">
	
	<div id="main-content">
		<div id="top-alert" class="fixed alert alert-error" style="display: none;">
			<button class="close fixed" style="margin-top: 4px;">&times;</button>
			<div class="alert-content">这是内容</div>
		</div>
		<div id="main" class="main">
			
	<div class="main-title">
		<h2>权限节点</h2>
	</div>
	<div class="cf">
		<div class="fl">
			<button class="btn" onclick="add();" target-form="ids">新 增</button>
			<button class="btn" onclick="cache()">缓存</button>
			<button class="btn" onclick="del()">删 除</button>
		</div>
		<div class="search-form fr cf">
			<div class="sleft">
				<input type="text" name="nickname" class="search-input" value="" placeholder="请输入配置名称">
				<a class="sch-btn" href="javascript:;" id="search" url="?s=/User/index.html">
					<i class="btn-search"></i>
				</a>
			</div>
		</div>
	</div>
	<div class="data-table table-striped">
		<!-- Think 系统列表组件开始 -->
<table id="checkList" class="list" ><thead><tr><th class="row-selected row-selected"><input class="check-all" type="checkbox" id="check" onclick="CheckAll('checkList')"></th><th width="60"><a href="javascript:sortBy('id','<?php echo ($sort); ?>','index')" title="按照编号<?php echo ($sortType); ?> ">编号<?php if(($order) == "id"): ?><img src="../Public/images/<?php echo ($sortImg); ?>.gif" width="12" height="17" border="0" align="absmiddle"><?php endif; ?></a></th><th><a href="javascript:sortBy('name','<?php echo ($sort); ?>','index')" title="按照节点标识<?php echo ($sortType); ?> ">节点标识<?php if(($order) == "name"): ?><img src="../Public/images/<?php echo ($sortImg); ?>.gif" width="12" height="17" border="0" align="absmiddle"><?php endif; ?></a></th><th><a href="javascript:sortBy('title','<?php echo ($sort); ?>','index')" title="按照节点名<?php echo ($sortType); ?> ">节点名<?php if(($order) == "title"): ?><img src="../Public/images/<?php echo ($sortImg); ?>.gif" width="12" height="17" border="0" align="absmiddle"><?php endif; ?></a></th><th width="70"><a href="javascript:sortBy('sort','<?php echo ($sort); ?>','index')" title="按照排序<?php echo ($sortType); ?> ">排序<?php if(($order) == "sort"): ?><img src="../Public/images/<?php echo ($sortImg); ?>.gif" width="12" height="17" border="0" align="absmiddle"><?php endif; ?></a></th><th><a href="javascript:sortBy('status','<?php echo ($sort); ?>','index')" title="按照状态<?php echo ($sortType); ?> ">状态<?php if(($order) == "status"): ?><img src="../Public/images/<?php echo ($sortImg); ?>.gif" width="12" height="17" border="0" align="absmiddle"><?php endif; ?></a></th><th >操作</th></tr></thead><tbody><?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr class="row" ><td><input class="ids" type="checkbox" name="key"	value="<?php echo ($vo["id"]); ?>"></td><td><?php echo ($vo["id"]); ?></td><td><a href="javascript:edit('<?php echo (addslashes($vo["id"])); ?>')"><?php echo ($vo["name"]); ?></a></td><td><?php echo ($vo["title"]); ?></td><td><?php echo ($vo["sort"]); ?></td><td><?php echo (sf($vo["status"],'model=&field=&value=&str0=启用&str1=禁用&id='.$vo['id'])); ?></td><td><a href="javascript:edit('<?php echo ($vo["id"]); ?>')">编辑</a>&nbsp;<a href="javascript:del('<?php echo ($vo["id"]); ?>')">删除</a>&nbsp;</td></tr><?php endforeach; endif; else: echo "" ;endif; ?></tbody></table>
<!-- Think 系统列表组件结束 -->

	</div>
	<div class="page"><div><?php echo ($page); ?></div></div>

		</div>
		<!-- <div class="cont-ft">
			<div class="copyright">
				<div class="fl">感谢使用<a href="http://www.onethink.cn" target="_blank">OneThink</a>管理平台</div>
				<div class="fr">V1.0.131129</div>
			</div>
		</div> -->
	</div>
	<script type="text/javascript">
        +function(){
            var $window = $(window), $subnav = $("#subnav"), url;
            $window.resize(function(){
                $("#main").css("min-height", $window.height() - 130);
            }).resize();
            $("#subnav h3 a").click(function(e){e.stopPropagation()});
	        /* 表单获取焦点变色 */
	        $("form").on("focus", "input", function(){
		        $(this).addClass('focus');
	        }).on("blur","input",function(){
				        $(this).removeClass('focus');
			        });
		    $("form").on("focus", "textarea", function(){
			    $(this).closest('label').addClass('focus');
		    }).on("blur","textarea",function(){
			    $(this).closest('label').removeClass('focus');
		    });
            // 导航栏超出窗口高度后的模拟滚动条
            var sHeight = $(".sidebar").height();
            var subHeight  = $(".subnav").height();
            var diff = subHeight - sHeight; //250
            var sub = $(".subnav");
            if(diff > 0){
                $(window).mousewheel(function(event, delta){
                    if(delta>0){
                        if(parseInt(sub.css('marginTop'))>-10){
                            sub.css('marginTop','0px');
                        }else{
                            sub.css('marginTop','+='+10);
                        }
                    }else{
                        if(parseInt(sub.css('marginTop'))<'-'+(diff-10)){
                            sub.css('marginTop','-'+(diff-10));
                        }else{
                            sub.css('marginTop','-='+10);
                        }
                    }
                });
            }
        }();
		//搜索功能
		$("#search").click(function(){
			var url = $(this).attr('url');
	        var query  = $('.search-form').find('input').serialize();
	        query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
	        query = query.replace(/^&/g,'');
	        if( url.indexOf('?')>0 ){
	            url += '&' + query;
	        }else{
	            url += '?' + query;
	        }
			window.location.href = url;
		});
		//回车搜索
		$(".search-input").keyup(function(e){
			if(e.keyCode === 13){
				$("#search").click();
				return false;
			}
		});
		$(function(){
			$('.row td:gt(0)').attr('nowrap','');
			$('.row th:gt(0)').attr('nowrap','');
			$('.row:gt(0)').click(function(e){
				if(e.target.name!='key'){
					// && !e.target.href
					var xx=$(this).find(':checkbox');
					xx.attr('checked',!xx.attr('checked'));
				}
			});
			$('.Abstruct').each(function(){
				if ($(this).attr('type')=='img'){
					var src=$(this).html();
					$(this).click(function(){
						$.dialog({ 
							title:'查看图片',
							content: src+'<br><img src="'+src+'" />'
						}); 
					});
				}else{
					var src=$(this).html();
					$(this).click(function(){
						$.dialog({ 
							title:'查看详细',
							content: eval(src)
						}); 
					});
				}
				$(this).attr('title',$(this).html());
			});

		})
	</script>
	
</body>
</html>